package com.sfx.controller;

import com.sfx.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
public class StudentBeans {
    //重命名不一样的bean名字
    //@Bean(value = "student_user")
    @Bean({"student_user1", "student"})
    public User studentUser(){
        //手动创建一个对象
        User user = new User();
        user.setName("studentBeans->李四");
        user.setAge(12);
        user.setId(32);
        return user;
    }
}
